#include <iostream>
using namespace std;

signed main()
{
    int n;
    cin>>n;
    int ans = 0,k = 1,right = 0;
    while(n){
        if(n%10==0){
            ans += (n/10)*k;
        }
        if(n%10==1){
            ans += (n/10)*k + right+1;
        }
        if(n%10>1){
            ans += (n/10+1)*k;
        }
        right += (n%10)*k;
        k *= 10;
        n /= 10;
    }
    cout<<ans;
    return 0;
}
